package com.tiny.mirror.service.product.domain.ability;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.tiny.mirror.basic.db.domain.ComplexValue;
import com.tiny.mirror.service.product.enums.AbilityLhcCategoryEnum;
import com.tiny.mirror.service.product.enums.AbilityLhcStrategyEnum;
import com.tiny.mirror.service.product.enums.AbilityLhcTypeEnum;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.javers.core.metamodel.annotation.Value;

/**
 * @Author: liujsh
 * @Description:
 * @Date: Create in 2023/10/19
 */
@Setter
@Getter
@Accessors(chain = true)
@Value
public class LhcParams implements Serializable, ComplexValue {

  @JsonProperty(value = "type")
  private AbilityLhcTypeEnum type;
  @JsonProperty(value = "play_list")
  private List<LhcPlayParams> playList;
  // 总体规则描述
  @JsonProperty(value = "rule")
  private String rule;


  @Setter
  @Getter
  @Accessors(chain = true)
  @Value
  public static class LhcPlayParams implements Serializable, ComplexValue {

    // 唯一标识
    @JsonProperty(value = "code")
    private String code;
    // 规则描述
    @JsonProperty(value = "rule")
    private String rule;
    // 分类
    @JsonProperty(value = "category")
    private AbilityLhcCategoryEnum category;
    // 玩法策略
    @JsonProperty(value = "strategy")
    private AbilityLhcStrategyEnum strategy;
    // 玩法名称
    @JsonProperty(value = "play")
    private String play;
    // 限制个数
    @JsonProperty(value = "limit")
    private Integer limit;
    // 赔率：用于选项赔率一致的显示
    @JsonProperty(value = "odds")
    private BigDecimal odds;
    // 选项&赔率
    @JsonProperty(value = "item_list")
    private List<LhcItemParams> itemList;
    // 子玩法
    @JsonProperty(value = "children_list")
    private List<LhcPlayParams> childrenList;
    // 返利百分比
    @JsonProperty(value = "reward_percent")
    private BigDecimal rewardPercent;
  }

  @Setter
  @Getter
  @Accessors(chain = true)
  @Value
  public static class LhcItemParams implements Serializable, ComplexValue {

    // 项目
    @JsonProperty(value = "item")
    private String item;
    // 赔率
    @JsonProperty(value = "odds")
    private BigDecimal odds;
  }
}